home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / SoundAndMusic / cmix / lib / oscili.c < prev    next >
Text File  |  1989-02-25  |  333b  |  14 lines

  1. float oscili(amp,si,farray,len,phs)      
  2. float amp,si,*farray,*phs;
  3. register len;
  4. {
  5.     register i =  *phs;        
  6.         register k =  (i + 1) % len;  
  7.     float frac = *phs  - i;      
  8.     *phs += si;                 
  9.     while(*phs >= len)
  10.         *phs -= len;       
  11.     return((*(farray+i) + (*(farray+k) - *(farray+i)) *
  12.                        frac) * amp);
  13. }
  14.